package nc.bs.pub.action;
import nc.bs.framework.common.NCLocator;
import nc.bs.mmpsc.mm_pscplansq.rule.unapprove.CheckPscplansqRule;
import nc.bs.pub.pluginPoint.PscplanPluginPoint;
import nc.vo.pub.BusinessException;
import nccloud.commons.lang.StringUtils;
import nc.vo.pub.compiler.PfParameterVO;
import nc.vo.uap.pf.PFBusinessException;
import nc.codeplatform.framework.service.AbstractPfScriptAction;
import nc.impl.pubapp.pattern.rule.processer.CompareAroundProcesser;
import nc.vo.mmpsc.mm_pscplansq.AggMmpscplansqVO;
import nc.itf.mmpsc.mm_pscplansq.mm_pscplansq.IMmpscplansqVOService;

public class N_56E7_SAVEBASE extends AbstractPfScriptAction<AggMmpscplansqVO>{
	
	public N_56E7_SAVEBASE(){
		super();
	}
	
	@Override
	protected AggMmpscplansqVO[] process(PfParameterVO paraVO) throws BusinessException {
		try {
			IMmpscplansqVOService service = NCLocator.getInstance().lookup(IMmpscplansqVOService.class);
			AggMmpscplansqVO[] vos = (AggMmpscplansqVO[])this.getVos();
			
			
			vos = service.callbackSAVEBASE(vos);
			
			return vos;
			
		}catch(Exception ex) {
			if (ex instanceof BusinessException) {
		        throw (BusinessException) ex;
		      }
	        throw new PFBusinessException(ex.getMessage(), ex);
		}
	}
	
	protected CompareAroundProcesser<AggMmpscplansqVO> getAroundProcessor(PfParameterVO paraVO) throws BusinessException {
		CheckPscplansqRule checkPscplansqRule = new CheckPscplansqRule();	
		CompareAroundProcesser<AggMmpscplansqVO>  compareAroundProcesser = new CompareAroundProcesser<AggMmpscplansqVO>(PscplanPluginPoint.UNAPPROVE);		
		compareAroundProcesser.addBeforeRule(checkPscplansqRule);
		return compareAroundProcesser;
	}
	
}